package com.yun2s.account.family.demo.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.yun2s.account.family.demo.service.HelloWorldService;


@Controller
@RequestMapping("/helloworld.do")
public class HelloWorldController{

       @Autowired
       private HelloWorldService helloWorldService;

       @RequestMapping
       public String getNewName(@RequestParam("userName") String userName, HttpServletRequest request){
              String newUserName = helloWorldService.getNewName(userName);
              request.setAttribute("newUserName", newUserName);
              return "HolleWorld";
       }

}